import http from "@/api";
import qs from "qs";

/**
 * @name 问题管理模块
 */

// 问题详情
export const findProblemById = params => {
  return http.post(`/pages/clientProblem!findProblemById.action`, qs.stringify(params), { loading: false });
};

// 问题指派
export const findAllHistoryRecordByClient = params => {
  return http.post(`/pages/clientProblem!problemAssign.action`, qs.stringify(params), { loading: false });
};

// 标识问题已知错误
export const actionFlow = params => {
  return http.post(`/pages/clientProblem!actionFlow.action`, qs.stringify(params), { loading: false });
};

// 保存问题解决方案
export const saveSolution = params => {
  return http.post(`/pages/clientProblem!saveSolution.action`, qs.stringify(params), { loading: false });
};

// 保存问题处理
export const saveComment = (flag, params) => {
  return http.post(`/pages/problem!saveComment.action?flag=${flag}`, qs.stringify(params), { loading: false });
};

// 问题分类
export const getCategoryTree = params => {
  return http.post(`/pages/event!getCategoryTree.action?num=50`, qs.stringify(params), { loading: false });
};

// 新增问题
export const saveProblem = (txt, params) => {
  return http.post(`/pages/problem!saveProblem.action?${txt}`, qs.stringify(params), { loading: false });
};
